import request from '@/utils/request'
// 调取获取角色列表接口
export const getRoleList = params => {
  return request({
    url: '/sys/role',
    params
  })
}
// 调取新增角色接口
export const addRole = data => {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}
// 调取当前角色的详情接口
export const detailsRole = id => {
  return request({
    url: `/sys/role/${id}`
  })
}
// 调取修改当前角色的接口
export const modifyRole = (data) => {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}
// 调取删除当前角色的接口
export const removeRole = id => {
  return request({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}
// 获取角色详情
export const getRole = id => {
  return request({
    url: `/sys/role/${id}`
  })
}
// 分配权限给角色
export const distributionRole = data => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
